package com.uniview.dao;

import com.uniview.base.BaseDao;
import com.uniview.entity.po.LoginLog;
import com.uniview.entity.po.LoginLog;
import com.uniview.entity.vo.Pager;
import com.uniview.entity.vo.QueryBuilder;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户登录日志Dao类
 * @author anconglee
 *
 */
@Repository("loginLogDao")
public class LoginLogDao extends BaseDao<LoginLog> {

	/**
	 * 保存角色信息
	 * @param loginLog
	 * @return
	 * @throws Exception
	 */
	public int saveLoginLog(LoginLog loginLog) throws Exception{
		return (int)this.save(loginLog);
	}
	
	/**
	 * 分页查找角色信息
	 * @param queryBuilder
	 * @param pageNo
	 * @param pageSize
	 * @return
	 * @throws Exception
	 */
	public Pager<LoginLog> findLoginLogByPage(QueryBuilder queryBuilder,int pageNo,int pageSize) throws Exception{
		return this.findPagerByQueryBuilder(queryBuilder, pageNo, pageSize);
	}
	
	/**
	 * 获取角色的记录总数
	 * @return
	 * @throws Exception
	 */
	public Long getTotalRow() throws Exception{
		return this.findTotalRow();
	}
	
	/**
	 * 根据id获取角色信息
	 * @param loginLogId
	 * @return
	 * @throws Exception
	 */
	public LoginLog findLoginLogById(int loginLogId) throws Exception{
		return this.find(loginLogId);
	}
}
